<? $page_title='采购明细汇总' ?>
<?include "FASHION/page_header.phtml"?>
<script language="JavaScript" src="<{$root}>/util/datepicker/WdatePicker.js"></script>

<form method="post">
    <?= htmlutil::makeTimesRangeBox() ?>
    &nbsp;选择月份:
<input type="text" name="month" value="<? fetch_a_string('month') ?>" size="12"
	   onfocus="WdatePicker({ dateFmt:'yyyy-MM', maxDate:'<? date('Y-m') ?>' })" class="wdate" />
 &nbsp; 部门：<?= htmlutil::dept_select('dept','') ?>
<input type="submit" value="汇总" />
</form>

<table border=0 class="list"><tbody>
<!--	<tr>
		<td colspan="20"><div class="right"><{$summary.demands}></div></td>
	</tr>-->
	<tr class="nobg">
		<th rowspan="2">编号</th>
		<th rowspan="2">材料名称</th>
		<th rowspan="2">品牌</th>
		<th rowspan="2">规格</th>
		<th rowspan="2">单位</th>
		<th colspan="3">补库采购</th>
		<th colspan="3">专项采购</th>
		<th colspan="3">紧急采购</th>
		<th colspan="3">小计</th>
		<th rowspan="2">部门</th>
		<th rowspan="2">供应商</th>
		<th rowspan="2" width="80">备注</th>
	</tr>
	<tr class="nobg">
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
	</tr>
<{if $summary.items}>
<{foreach item=ware from=$summary.items}>
	<{foreach item=dept from=$ware.list}>
	<tr>
		<td><{$ware.sno}></td>
		<td><{$ware.name}></td>
		<td><{$ware.brand}></td>
		<td><{$ware.specific}></td>
		<td><{$ware.unit}></td>

		<td><div class="decimal"><{$dept.0.amount}></div></td>
<{if $dept.0.amount && floatval($ware.price) }>
		<td><div class="decimal fnum"><{$ware.price}></div></td>
		<td><div class="decimal fnum"><{= $ware.price*$dept.0.amount}></div></td>
<{else}>
		<td></td>
		<td></td>
<{/if}>
		<td><div class="decimal"><{$dept.1.amount}></div></td>
<{if $dept.1.amount && floatval($ware.price) }>
		<td><div class="decimal fnum"><{$ware.price}></div></td>
		<td><div class="decimal fnum"><{= $ware.price*$dept.1.amount}></div></td>
<{else}>
		<td></td>
		<td></td>
<{/if}>
		<td><div class="decimal"><{$dept.2.amount}></div></td>
<{if $dept.2.amount && floatval($ware.price) }>
		<td><div class="decimal fnum"><{$ware.price}></div></td>
		<td><div class="decimal fnum"><{= $ware.price*$dept.2.amount}></div></td>
<{else}>
		<td></td>
		<td></td>
<{/if}>
		<td><div class="decimal"><{$ware.amount}></div></td>
		<td><div class="decimal fnum"><{$ware.price}></div></td>
		<td><div class="decimal fnum"><{$ware.total}></div></td>

		<td><{$dept.name}></td>
		<td><{$dept.supplier_name}></td>
		<td><{$dept.remark}></td>
	</tr>
	<{/foreach}>
<{/foreach}>
<{/if}>
</tbody></table>

<?include "FASHION/page_footer.phtml"?>
